package cn.xiangxiang.mapper.goods;

import cn.xiangxiang.pojo.goods.Brand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface BrandMapper extends BaseMapper<Brand> {

    @Select("select name,image from tb_brand where id in " +
            "( select brand_id from tb_category_brand where category_id in  " +
            "( select id from tb_category where name =  #{categoryName} )  " +
            ")")
    public List<Map> findBrandByCategoryName(@Param("categoryName") String categoryName);
}
